<?php
namespace app\admin\validate;
use think\Validate;
class Tags extends Validate
{
    //验证规则
    protected $rule = [
        'tagname'  =>  'require|max:25|unique:tags',
    ];
    //错误提示
    protected $message = [
        'tagname.require' => 'Tag标签必须填写',
        'tagname.max'     => 'Tag标签长度必须小于25位',
        'tagname.unique'   => 'Tag标签不得重复',
    ];
    //验证场景
    protected  $scene = [
        'add'  => ['tagname'],
        'edit' => ['tagname'],
    ];
}
